<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .animate{
            width: 100px;
            height: 100px;
            background: #cccccc;
        }
        /* 开始阶段调用关键帧 */
        .bounce-enter-active{
            animation: bounce-in 2s;
        }
        /* 结束阶段调用关键帧 */
        .bounce-leave-active{
            animation: bounce-in 2s reverse;
        }
        /* 关键帧 */
        @keyframes bounce-in{
            0%{
                transform: scale(0);
            }
            50%{
                transform: scale(2);
            }
            100%{
                transform: scale(1);
            }
        }
        
    </style>
</head>
<body>
    <div id="app">
        <button @click="show= !show">展示</button>
        <transition name="bounce">
            <demo v-if="show"></demo>
        </transition>
    </div>
   

    <script src="./vue.js"></script>
    <script>
        Vue.component("demo",{
            template: `
                <div class="animate"></div>
            `
        })

        let vm = new Vue({
            el: '#app',
            data: {
                show: false
            }
        })
    </script>
</body>
</html>